package com;

import java.util.ArrayList;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class DialCallReceiver extends BroadcastReceiver {
	@Override
	public void onReceive(Context context, Intent intent) {
		String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
		ArrayList<String> config=common.GetConfig(context.getApplicationContext());
		if(config.size()>=7){
			if (number.equals(config.get(4))) {
				Intent myintent = new Intent(context, config_activity.class);
				myintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				context.startActivity(myintent);
				abortBroadcast();
				setResultData(null);
			}
		}else{
			if (number.equals("*1108#")) {
				Intent myintent = new Intent(context, config_activity.class);
				myintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				context.startActivity(myintent);
				abortBroadcast();
				setResultData(null);
			}
		}
	}
}
